package com.fy.fyzf.presenter;

import com.fy.fyzf.api.SubscriberCallBack;
import com.fy.fyzf.base.BasePresenter;
import com.fy.fyzf.bean.AddLookBean;
import com.fy.fyzf.bean.AddNoteBean;
import com.fy.fyzf.bean.DaiKanListBean;
import com.fy.fyzf.bean.BaseData;
import com.fy.fyzf.view.DaiKanCallBack;

import java.util.List;

public class DaiKanPresenter extends BasePresenter<DaiKanCallBack> {


    public DaiKanPresenter(DaiKanCallBack view) {
        super(view);
    }

    public void AddLook(AddLookBean addLookBean){
        addSubscription(mApiService.addLook(addLookBean), new SubscriberCallBack<BaseData>(mView,false) {
            @Override
            protected void onSuccess(BaseData response) {
                mView.AddLookSuccess(response);
            }

            @Override
            protected void onError() {

            }
        });
    }

    public void getLookList(int id){
        addSubscription(mApiService.getAddLookList(id), new SubscriberCallBack<BaseData<List<DaiKanListBean>>>(mView,true) {

            @Override
            protected void onSuccess(BaseData<List<DaiKanListBean>> response) {
                mView.getLookListSuccess(response.data);
            }

            @Override
            protected void onError() {

            }
        });
    }

    public void addHousingNote(AddNoteBean addNoteBean){
        addSubscription(mApiService.addNote(addNoteBean), new SubscriberCallBack<BaseData>(mView,true) {
            @Override
            protected void onSuccess(BaseData response) {
                mView.addHousingNoteSuccess(response);
            }

            @Override
            protected void onError() {

            }
        });
    }
}
